find_root ( func, x, tol = 1.0e-8, fcn_calls = 400 ) Types: func Stmt x double[] tol double fcn_calls int
[double[],double[]] (root of \e\func\e\ and function values)
In Xi the function func will be determined in a similar way like writing it down on a piece of paper. x< -> y : y=f (x). The parameter x contains an initial estimate of the solution vector. Termination occurs when the algorithm estimates that the relative error between x and the solution is at most tol. Termination also occurs when the number of calls to the function func is at least fcn_calls by the end of an iteration.
( 1)>[x,f]=find_root([x->y: y=cos(x);],{2}); Message: algorithm estimates that the relative error between x and the solution is at most tol in function find_root ( 2)>print(x,f); <dblarr> 1.570796327 <dblarr> 6.123031769e-17 ( 3)>print(find_root([x->y: y=cos(x);],{2, 4})); Message: algorithm estimates that the relative error between x and the solution is at most tol in function find_root <dblarr> 1.570796327 4.71238898 ( 4)>double[] f(double x[]) { return {sin(x[0]),3*cos(x[1]),cos(x[0]*x[2])};} Function f defined ( 5)>print(find_root( [q->z : z=f(q);], {2,2,2}, \tol=1e-5,\fcn_calls=30)); Message: algorithm estimates that the relative error between x and the solution is at most tol in function find_root <dblarr> 3.141592654 1.570796327 1.5
c argonne national laboratory. minpack project. march 1980. c burton s. garbow, kenneth e. hillstrom, jorge j. more
minimize ( func, x, tol = 1.0e-8, fcn_calls = 400 ) Types: func Stmt x double[] tol double fcn_calls int
[double[],double[]] (minimum of \e\func\e\ and function values)
In Xi the function func will be determined in a similar way like writing it down on a piece of paper. x -> y : y=f (vector). The parameter x contains an initial estimate of the solution vector. Termination occurs when the algorithm estimates either that the relative error in the sum of squares is at most tol or that the relative error between x and the solution is at most tol. Termination also occurs when the number of calls to the function func is at least fcn_calls by the end of an iteration.
( 1)>[x0,f0]=minimize( [ x->y : y=sin(x); ], {2} ); Message: algorithm estimates that the relative error between x and the solution is at most tol in function minimize ( 2)>print(x0, f0); <dblarr> 3.141592654 <dblarr> 1.224606354e-16 ( 3)>print(minimize( [ x->y : y=sin(x); ], {2,5} )); Message: algorithm estimates that the relative error between x and the solution is at most tol in function minimize <dblarr> 3.141592654 9.424777961 ( 4)>double[] f(double x[]) { return {sin(x[0]),3*cos(x[1]),cos(x[0]*x[1])};} Function f defined ( 5)>[x,f]=minimize( [q->z : z=f(q);], {1,1}, \tol=1e-5); Message: algorithm estimates that the relative error in the sum of squares is at most tol in function minimize ( 6)>print(x,f); <dblarr> 0.7711744677 1.597605977 <dblarr> 0.6969779212 -0.08041931522 0.3323210158
c argonne national laboratory. minpack project. march 1980. c burton s. garbow, kenneth e. hillstrom, jorge j. more